package com.bolingcavalry.crm.user.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.base.ResponseResult;
import com.bolingcavalry.crm.user.domain.Login;
import com.dto.*;
import com.dto.user.UserDTO;
import com.dto.user.UserRoleListDto;
import com.entity.user.User;
import com.vo.*;
import com.vo.user.*;

import java.util.List;
import java.util.Map;

public interface UserService   {

    /**
     * 根据用户名获取角色
     * @param username
     * @return
     */
    List<String> getRole(String username);

    /**
     * 登录时候密码解密校验，获取密码
     * @param username
     * @return
     */
    String getPassword(String username);

    //插入用户
    Boolean insect(UserDTO user);

    Long getRoleIdByRoleName(String role);

    List<PermissionVO> getPermissionsByRoleId(Long roleId);

    void addPermission(PermissionDTO permissionDTO);

    //获取所有角色名称和id
    List<RoleVO> getRoleAndId();

    Boolean addRole(RoleDTO roleDTO);

    List<UserStatusVO> getUserStatus();

    IPage<UserDTO> getByConditions(Integer pageNum, Integer pageSize, String status, String username, String nickname);

    Boolean update(UserDTO userDTO);

    Boolean deleteById(Long id);

    UserDTO getUserById(Long id);

    UserStatusCountVO getUserStatusCount();

    Boolean userupdate(UserDTO userDTO);

    User checkOpenid(String openid);

    ResponseResult<Map<String, Object>> login(Login login);

    ResponseResult<Map<String, Object>> wxtoken(String username);

    ResponseResult<String> openidbind(UserDTO userDTO);

    UserVO getUserVO(String username);

    ResponseResult<String> updatePassword(PasswordDTO passwordDTO);

    User findByOpenId(String openid);

    List<UserRoleListVo> getUserList(UserRoleListDto roleNames);

    List<String> getAllUserList(String nickName);

    List<UserlocationVO> getUserListByStatus(String status);
}
